package com.yzz.hzraisedust.hzraseidust.modelbean;

import com.yzz.hzraisedust.hzraseidust.util.AirQualityUtil;

import java.io.Serializable;

/**
 * Created by zhengzhen on 2017/8/28.
 */

public class ProjectAirItemBean implements Serializable{

    private String name;
    private float pm2_5;
    private float pm10;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public float getPm2_5() {
        return pm2_5;
    }

    public void setPm2_5(float pm2_5) {
        this.pm2_5 = pm2_5;
    }

    public float getPm10() {
        return pm10;
    }

    public void setPm10(float pm10) {
        this.pm10 = pm10;
    }
    private int  backgroudColor;

    public int getBackgroudColor() {
        return backgroudColor;
    }

    private String pmDescribe;

    public String getPmDescribe() {
        return pmDescribe;
    }

    public  void concute(){
        if(pm10 > AirQualityUtil.WORSET_AIR){
            backgroudColor = AirQualityUtil.WORSET_COLOR;
            pmDescribe = "严重污染:"+pm10;
        }else if(pm10 > AirQualityUtil.SERIOURS_AIR){
            backgroudColor =  AirQualityUtil.WORSE_COLOR;
            pmDescribe = "重度污染:"+pm10;
        }else if(pm10 >AirQualityUtil.WRNING_AIR){
            backgroudColor = AirQualityUtil.MIDDLE_WORSE_COLOR;
            pmDescribe = "中度污染:"+pm10;
        }else if(pm10 > AirQualityUtil.BETTER_AIR){
            backgroudColor =  AirQualityUtil.LITTLE_WORSE_COLOR;
            pmDescribe = "轻度污染:"+pm10;
        }else if(pm10 > AirQualityUtil.BEST_AIR){
            backgroudColor = AirQualityUtil.NORMAL_COLOR;
            pmDescribe = "良:"+pm10;
        }else if(pm10 >0){
            backgroudColor = AirQualityUtil.GOOD_COLOR;
            pmDescribe = "优:"+pm10;
        }else{
            backgroudColor = AirQualityUtil.OFFLINE_COLOR;
            pmDescribe = "暂无";
        }
        concutePm2_5();
    }

    private int pm2_5BakcgroudColor;

    public int getPm2_5BakcgroudColor() {
        return pm2_5BakcgroudColor;
    }
    private String pm2_5Descirbe;

    public String getPm2_5Descirbe() {
        return pm2_5Descirbe;
    }

    private void concutePm2_5(){
        if(pm2_5 > AirQualityUtil.PM2_5_WORSET_AIR){
            pm2_5BakcgroudColor = AirQualityUtil.WORSET_COLOR;
            pm2_5Descirbe = "严重污染:"+pm2_5;
        }else if(pm2_5 > AirQualityUtil.PM2_5_SERIOURS_AIR){
            pm2_5BakcgroudColor = AirQualityUtil.WORSE_COLOR;
            pm2_5Descirbe = "重度污染:"+pm2_5;
        }else if(pm2_5 >AirQualityUtil.PM2_5_WRNING_AIR){
            pm2_5BakcgroudColor =  AirQualityUtil.MIDDLE_WORSE_COLOR;
            pm2_5Descirbe = "中度污染:"+pm2_5;
        }else if(pm2_5 > AirQualityUtil.PM2_5_BETTER_AIR){
            pm2_5BakcgroudColor = AirQualityUtil.LITTLE_WORSE_COLOR;
            pm2_5Descirbe = "轻度污染:"+pm2_5;
        }else if(pm2_5 > AirQualityUtil.PM2_5_BEST_AIR){
            pm2_5BakcgroudColor = AirQualityUtil.NORMAL_COLOR;
            pm2_5Descirbe = "良:"+pm2_5;
        }else if(pm2_5 >0){
            pm2_5BakcgroudColor = AirQualityUtil.GOOD_COLOR;
            pm2_5Descirbe = "优:"+pm2_5;
        }else{
            pm2_5BakcgroudColor = AirQualityUtil.OFFLINE_COLOR;
            pm2_5Descirbe = "暂无";
        }
    }

}
